Improve transit search and setup - #3
Conversation
- Merge Bustang GTFS into RTD Denver as an additional static feed, with per-feed ID namespacing (feed1:) to prevent key collisions. - Rework GtfsIngestor to build a temp database and atomically move it into place, avoiding deleting an in-use database (SQLiteReadOnlyDatabaseException). - Use ZipFile instead of ZipInputStream for reliable entry reads. - Serialize ingestion with a mutex and cancel the previous ingest job when switching agencies. - Store feed URLs in feed_meta.txt so a changed URL forces a refresh. - Support directionless routes (nullable directionId) end-to-end and auto-skip direction selection when a route has no directions. - Disable RIPTA realtime (HTTP-only feeds) and remove the :netconfig cleartext exception module.
There was a problem hiding this comment.
Pull request overview
This PR expands the transit tool’s GTFS ingestion and browsing capabilities by supporting multi-feed static GTFS ingestion (RTD Denver + Bustang) with ID namespacing, improving ingestion reliability during agency switching, enabling schedule browsing for routes without direction_id, and restoring RIPTA realtime support via a narrowly scoped cleartext networking exception.
Changes:
- Add multi-feed static ingestion for RTD Denver (including Bustang) with per-feed ID namespacing and improved ingestion reliability (temp DB + atomic replace, ZipFile streaming, serialized ingests).
- Allow nullable
direction_idthrough stop/departure selection flows and auto-advance directionless routes. - Restore RIPTA realtime feed URLs and reintroduce
:netconfigfor a host-scoped cleartext exception; update docs accordingly.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tool/src/main/kotlin/com/thelightphone/transit/HomeScreen.kt | Cancels stale ingest jobs on agency switch and prevents older ingests from overwriting newer UI state. |
| tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsRepository.kt | Allows nullable direction_id queries for stops/departures to support directionless routes. |
| tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsIngestor.kt | Adds serialized ingestion, multi-feed loading with ID prefixes, ZipFile-based parsing, and temp DB replacement. |
| tool/src/main/kotlin/com/thelightphone/transit/gtfs/GtfsAgency.kt | Adds RTD additional static feed URL(s) and updates RIPTA realtime documentation/fields. |
| tool/src/main/kotlin/com/thelightphone/transit/FirstStopSelectionScreen.kt | Propagates nullable directionId into stop selection flow. |
| tool/src/main/kotlin/com/thelightphone/transit/DirectionSelectionScreen.kt | Auto-advances directionless routes directly to stop selection. |
| tool/src/main/kotlin/com/thelightphone/transit/DepartureListScreen.kt | Propagates nullable directionId into departure listing flow. |
| tool/README.md | Updates user-facing notes about RIPTA HTTP-only realtime with scoped exception. |
| tool/build.gradle.kts | Documents the RIPTA cleartext exception dependency on :netconfig. |
| settings.gradle.kts | Adds mavenLocal() to dependency resolution repositories. |
| README.md | Updates top-level documentation about RIPTA HTTP-only realtime with scoped exception. |
| netconfig/src/main/res/xml/network_security_config.xml | Restricts cleartext allowance to realtime.ripta.com and updates module comments. |
| netconfig/src/main/AndroidManifest.xml | Supplies networkSecurityConfig via manifest merge for the tool app. |
| netconfig/build.gradle.kts | Simplifies module header commentary while preserving purpose. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| dependencyResolutionManagement { | ||
| repositories { | ||
| mavenLocal() | ||
| google() | ||
| mavenCentral() | ||
| maven { |
| LaunchedEffect(state) { | ||
| if (state is DirectionSelectionState.Loaded && (state as DirectionSelectionState.Loaded).directions.isEmpty()) { | ||
| navigateTo(screenFactory = { activity -> | ||
| FirstStopSelectionScreen(activity, dbFile, routeId, routeLabel, null, "Route") | ||
| }) |
There was a problem hiding this comment.
I'll investigate and fix this.
There was a problem hiding this comment.
Thanks, once this is set I'll merge, just a heads up I have a pending commit to add a few more settings. "Show everything" mode which eliminates the need to get per stop taps to show more vehicles and it enables a few more tap and hold navigation features. In addition, home screen is being enabled for a scroll list for Agency feeds so we can add more. someone asked on Reddit for London to be added. Thanks for your support on both the HTTP:// issue and finding a way to get bustang in, I appreciate how you added it as an agency component similar to how MBTA's v3 api is integrated! 🙏.... One note, from what I can see on your recent changes this only seems to add bustang's static feed, meaning live locations for bustang, (unless available through RTD's standard realtime feed) won't show up but scheduled times will.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
git-subtree-dir: third_party/light-keyboard git-subtree-split: 1755571b1d3353ecd3c6b68018079903ca4e389b
…ty/light-keyboard'
…ture/rtd-ripta-live
What changed
Testing
./gradlew :tool:assembleDebugsucceeds.